import { ref } from 'vue';
import { getPaymentCardDetailApi } from '@/api/sj/financialManagement/paymentCard/index'

const usePaymenDtetails = () => {

    const detailsVisible = ref(false);
    const detailsRow = ref({});
    const datailsList = ref([]);

    /** 打开 详情 弹窗 */
    const handlOpenDetails = async (row: any) => {
        getDetails(row.id);
        detailsRow.value = row;
        detailsVisible.value = true;
    };

    /** 获取详情 */
    const getDetails = async (id: any) => {
        const res = await getPaymentCardDetailApi(id);
        datailsList.value = res.data;
    };


    return {
        detailsVisible,
        detailsRow,
        datailsList,
        handlOpenDetails,
    }
};

export default usePaymenDtetails;
